#!/bin/bash
DIR=dir

cd $DIR
number=`ls|wc -l`
count=`expr $number - 1`
rm -f `ls |head -$count`
